package com.stable.spider.ths;

import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;

import java.io.FileOutputStream;

public class Test2 {
    public static void main(String[] args) throws Exception {

//        String url = "http://emweb.securities.eastmoney.com/NewFinanceAnalysis/zcfzbAjax?companyType=4&reportDateType=1&reportType=1&endDate=&code=SH600519";
//        JSONObject jsonObject = HttpUtil.doGet(url);
//        System.out.println(jsonObject);
        String filePath = "C:\\Users\\chou\\Downloads\\sample.xls";//文件路径
        HSSFWorkbook workbook = new HSSFWorkbook();//创建Excel文件(Workbook)

        HSSFSheet sheet = workbook.createSheet("计算FCFF");// 创建工作表(Sheet)
        HSSFRow row1 = sheet.createRow(0);
        HSSFCell row1cell0 = row1.createCell(0);
        row1cell0.setCellValue("1");

        HSSFSheet sheet2 = workbook.createSheet("计算FCFF2");// 创建工作表(Sheet)
        HSSFRow row2 = sheet2.createRow(0);
        HSSFCell row2cell0 = row2.createCell(0);
        row2cell0.setCellValue("2");

        FileOutputStream out = new FileOutputStream(filePath);
        workbook.write(out);//保存Excel文件
        out.close();//关闭文件流\\
        System.out.println("OK!");
    }
}
